/**   
 * Copyright © 2016 公司名. All rights reserved.
 * 
 * @Title: NoticeRestController.java 
 * @Prject: LianniuManager
 * @Package: com.lianniu.mgr.baseService.notice.controller
 * @Description: TODO
 * @author: lzz   
 * @date: 2016年8月8日 下午2:03:11 
 * @version: V1.0   
 */
package com.lianniu.mgr.baseService.notice.controller;

import javax.annotation.Resource;

import org.apache.log4j.Logger;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.lianniu.mgr.base.BaseResult;
import com.lianniu.mgr.baseService.notice.model.NoticeVo;
import com.lianniu.mgr.baseService.notice.service.INoticeService;
import com.lianniu.mgr.pagination.PaginationInfo;

/** 
 * @ClassName: NoticeRestController 
 * @Description: TODO
 * @author: lzz
 * @date: 2016年8月8日 下午2:03:11  
 */
@Controller
@RequestMapping("rest")
public class NoticeRestController {
    
    private final static Logger logger = Logger.getLogger(NoticeController.class);
    
    @Resource
    private INoticeService noticeService;
    /**
     * @Title: getNoticeList 
     * @Description: 消息列表
     * @author: lzz
     * @param noticeVo
     * @param paginationInfo
     * @return
     * @date: 2016年8月8日 下午2:09:07 
     * @return: BaseResult
     */
    @RequestMapping(value={"getNoticeList"},method=RequestMethod.POST)
    public @ResponseBody BaseResult getNoticeList(NoticeVo noticeVo,PaginationInfo paginationInfo){
        logger.info("NoticeRestController getNoticeList begin");
        BaseResult result = noticeService.getNoticeList(noticeVo, paginationInfo);
        logger.info("NoticeRestController getNoticeList end");
        return result;
    }
    /**
     * @Title: pushNotice 
     * @Description: 发布消息
     * @author: lzz
     * @param noticeVo
     * @return
     * @date: 2016年8月8日 下午2:09:21 
     * @return: BaseResult
     */
    @RequestMapping(value={"pushNotice"},method=RequestMethod.POST)
    public @ResponseBody BaseResult pushNotice(NoticeVo noticeVo){
        logger.info("NoticeRestController pushNotice begin");
        BaseResult result = noticeService.pushNotice(noticeVo);
        logger.info("NoticeRestController pushNotice end");
        return result;
    }
    /**
     * @Title: saveNotice 
     * @Description: 保存消息
     * @author: lzz
     * @param noticeVo
     * @return
     * @date: 2016年8月8日 下午2:22:14 
     * @return: BaseResult
     */
    @RequestMapping(value={"saveNotice"},method = RequestMethod.POST)
    public @ResponseBody BaseResult saveNotice(NoticeVo noticeVo){
        logger.info("NoticeRestController saveNotice begin");
        BaseResult result = noticeService.saveNotice(noticeVo);
        logger.info("NoticeRestController saveNotice end");
        return result;
    }
    /**
     * @Title: getNotice 
     * @Description: 获取消息
     * @author: lzz
     * @param noticeId
     * @return
     * @date: 2016年8月8日 下午2:22:35 
     * @return: BaseResult
     */
    @RequestMapping(value={"getNotice"},method = RequestMethod.GET)
    public @ResponseBody BaseResult getNotice(long noticeId){
        logger.info("NoticeRestController getNotice begin");
        BaseResult result = noticeService.getNotice(noticeId);
        logger.info("NoticeRestController getNotice end");
        return result;
    }
    /**
     * @Title: delNotice 
     * @Description: 删除消息
     * @author: lzz
     * @param noticeId
     * @return
     * @date: 2016年8月8日 下午2:22:46 
     * @return: BaseResult
     */
    @RequestMapping(value={"delNotice"},method = RequestMethod.GET)
    public @ResponseBody BaseResult delNotice(long noticeId){
        logger.info("NoticeRestController delNotice begin");
        BaseResult result = noticeService.delNotice(noticeId);
        logger.info("NoticeRestController delNotice end");
        return result;
    }
}
